﻿#ifndef TCPFORM_H
#define TCPFORM_H

#include <QWidget>
#include <QTcpServer>
#include <QTcpSocket>

namespace Ui {
class TcpForm;
}

class TcpForm : public QWidget
{
    Q_OBJECT

public:
    explicit TcpForm(QWidget *parent = nullptr);
    ~TcpForm();

private:
    Ui::TcpForm *ui;
    QTcpServer *m_pTcpServer = nullptr;
    QTcpSocket *m_pServerTcpSocket = nullptr;
    QTcpSocket *m_pClientTcpSocket = nullptr;

public: signals:
    void statusBarShow(QString msg);

private slots:
    void on_listen();
    void on_newConnection();
    void on_serverReceive();
    void on_serverDisconnected();
    void on_stop();
    void on_serverClear();
    void on_serverSend();
    void on_connect();
    void on_break();
    void on_clientClear();
    void on_clientSend();
    void on_clientRecive();
    void on_clientDisconnected();
};

#endif // TCPFORM_H
